package com.whut.mall.exception;

/**
 * @author xh
 * @date 2022/3/25 20:20
 * 统一异常
 */
public class ExceptionMall extends RuntimeException{
    private final Integer code;

    private final String message;

    public ExceptionMall(Integer code, String message){
        this.code = code;
        this.message = message;
    }

    public ExceptionMall(ExceptionEnum exceptionEnum){
        this(exceptionEnum.getCode(), exceptionEnum.getMsg());
    }

    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
